home *** CD-ROM | disk | FTP | other *** search
/ GameStar 1998 November (Bonus) / GAMESTAR11B.ISO / ENCYC99 / MM / T620273A.DCR / scripts_24_Class FixedPiece.ls < prev    next >
Encoding:
Text File  |  1998-07-02  |  1.1 KB  |  66 lines

  1. property infoBox, sendsEvent, cursorGod, objectRect, puzzleGod, pieceType
  2.  
  3. on mouseEvent me, xEvent, xLoc
  4.   case xEvent of
  5.     #mouseEnter:
  6.       pointCursor(cursorGod)
  7.     #mouseLeave:
  8.       plainCursor(cursorGod)
  9.     #mouseDown:
  10.       newActivePiece(puzzleGod, me)
  11.     #mouseGone:
  12.       plainCursor(cursorGod)
  13.   end case
  14. end
  15.  
  16. on areYouThere me, xLoc
  17.   return inside(xLoc, objectRect)
  18. end
  19.  
  20. on highlight me
  21.   catchEvent(infoBox, sendsEvent)
  22. end
  23.  
  24. on unHighlight me
  25.   nothing()
  26. end
  27.  
  28. on getType me
  29.   return pieceType
  30. end
  31.  
  32. on new me, xList
  33.   set objectRect to getAt(xList, 1)
  34.   set pieceType to getAt(xList, 2)
  35.   return me
  36. end
  37.  
  38. on linkUp me, xPuzzleGod, xInfoBox
  39.   set puzzleGod to xPuzzleGod
  40.   set infoBox to xInfoBox
  41.   set sendsEvent to addThing(infoBox, me)
  42. end
  43.  
  44. on subscribe me, xCursor
  45.   if cursorGod = 0 then
  46.     nothing()
  47.   else
  48.     unsubscribe(cursorGod, me)
  49.   end if
  50.   set cursorGod to xCursor
  51.   subscribe(cursorGod, me)
  52. end
  53.  
  54. on unsubscribe me
  55.   if cursorGod = 0 then
  56.     nothing()
  57.   else
  58.     unsubscribe(cursorGod, me)
  59.   end if
  60. end
  61.  
  62. on destroy me
  63.   unsubscribe(me)
  64.   set me to 0
  65. end
  66.